<?php
	chong_pha_hoai();
?>
<?php
	$so=count($_SESSION[$ten_danh_dau.'id_giohang']);
	if($so!=0)
	{
		$trung_lap="khong";
		for($r=0;$r<$so;$r++)
		{
			$id_r=$_SESSION[$ten_danh_dau.'id_giohang'][$r];
			if($r==$_GET['id_sp_nnn'])
			{
				$trung_lap="co";
				$_SESSION[$ten_danh_dau.'solg_abc'][$r]=$_SESSION[$ten_danh_dau.'solg_abc'][$r]+$_GET['solg_nnn'];
				break;
			}
		}
		if($trung_lap=="khong")
		{
			$_SESSION[$ten_danh_dau.'id_giohang'][$so]=$_GET['id_sp_nnn'];
			$_SESSION[$ten_danh_dau.'solg_abc'][$so]=$_GET['solg_nnn'];
		}
	}
	else
	{
		$_SESSION[$ten_danh_dau.'id_giohang'][0]=$_GET['id_sp_nnn'];
		$_SESSION[$ten_danh_dau.'solg_abc'][0]=$_GET['solg_nnn'];
	}
	chuyentrang("?thamso=gio_hang");
	exit();
?>